Skip to content

[4.0.x] Fix mvn.cmd jvm.config read failing silently on Windows CI#12379

Merged
gnodet merged 1 commit into
maven-4.0.xfrom
backport/maven-4.0.x/pr-12378
Jun 27, 2026
Merged

[4.0.x] Fix mvn.cmd jvm.config read failing silently on Windows CI#12379
gnodet merged 1 commit into
maven-4.0.xfrom
backport/maven-4.0.x/pr-12378

Conversation

@gnodet

@gnodet gnodet commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Backport of #12378 to maven-4.0.x.

  • Replace for /f with set /p <file when reading JvmConfigParser output in mvn.cmd
  • for /f silently skips locked files (e.g. Windows Defender real-time scanning), leaving JVM_CONFIG_MAVEN_OPTS empty and causing intermittent MNG-4559 test failures on Windows CI (~30% failure rate)
  • set /p uses different file sharing flags and is far less susceptible to lock contention
  • Adds a single retry with brief delay as defense-in-depth

Test plan

🤖 Generated with Claude Code

Replace 'for /f' with 'set /p' + input redirect to read the
JvmConfigParser temp file. 'for /f' silently produces no output
when the file is briefly locked by Windows Defender real-time
scanning, leaving JVM_CONFIG_MAVEN_OPTS empty and causing
MavenITmng4559 tests to fail intermittently on Windows CI runners.

'set /p <file' uses a transient input-redirect open with different
sharing flags, making it far less susceptible to lock contention.
If the file IS locked, it emits a visible error to stderr rather
than failing silently. A single retry with a brief delay is added
as a safety net.

Direct stdout capture ('for /f ... in (`command`)') was tried
previously (343b518) and reverted (7685323) because cmd.exe's
child shell interprets special characters (pipes, ampersands) in
the captured output, breaking jvm.config values like
-Dhttp.nonProxyHosts=de|*.de.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet gnodet modified the milestones: 4.0.0, 4.0.0-rc-6 Jun 26, 2026
@gnodet gnodet merged commit a45d662 into maven-4.0.x Jun 27, 2026
24 checks passed
@gnodet gnodet deleted the backport/maven-4.0.x/pr-12378 branch June 27, 2026 09:42
@github-actions

Copy link
Copy Markdown

@gnodet Please assign appropriate label to PR according to the type of change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants